//看板的对应关系
const boardMap = {
	transformData(originalData) {
		// 定义字段映射关系
		const fieldMappings = [{
				key: 'dzsl',
				title: '电站数量',
				unit: '个',
				transform: val => val
			},
			{
				key: 'fjsl',
				title: '风机数量',
				unit: '台',
				transform: val => val
			},
			{
				key: 'zjrl',
				title: '装机容量',
				unit: 'MW',
				transform: val => val
			},
			{
				key: 'drfdl',
				title: '当日发电量',
				unit: 'MWh',
				transform: val => val
			},
			{
				key: 'dyfdl',
				title: '当月发电量',
				unit: 'MWh',
				transform: val => val
			},
			{
				key: 'dnfdl',
				title: '当年发电量',
				unit: 'MWh',
				transform: val => val
			},
			{
				key: 'fdzl',
				title: '总发电量',
				unit: 'MWh',
				transform: val => val,
				// unit: 'GWh', 
				// transform: val => (val / 1000).toFixed(2) // 转换为GWh
			}
		];

		// 执行转换
		return fieldMappings.map(item => {
			return {
				value: item.transform(originalData[item.key] || '0'), // 处理可能的undefined
				title: `${item.title}(${item.unit})`
			};
		});
	},
	//储能的
	storagetransformData(originalData) {


		// 定义字段映射关系
		const fieldMappings = [{
				key: 'cnzsl',
				title: '储能站数量',
				unit: 'kW',
				transform: val => val
			},
			{
				key: 'cnzzrl',
				title: '储能站总容量',
				unit: 'kWh',
				transform: val => val
			},
			{
				key: 'gjtm',
				title: '告警条目',
				unit: '个',
				transform: val => val
			},
			{
				key: 'zcdl',
				title: '总充电量',
				unit: 'kWh',
				transform: val => val
			},
			{
				key: 'zfdl',
				title: '总放电量',
				unit: 'kWh',
				transform: val => val
			},
			{
				key: 'zcdsj',
				title: '总充电时间',
				unit: 'h',
				transform: val => val
			},
			{
				key: 'zfdsj',
				title: '总放电时间',
				unit: 'h',
				transform: val => val
			}
		];
		// 执行转换
		return fieldMappings.map(item => {
			return {
				value: item.transform(originalData[item.key] || '0'), // 处理可能的undefined
				title: `${item.title}(${item.unit})`
			};
		});
	},



}

export default boardMap;